clear
set more off

use "$statadir/amendment_timing", clear

qui keep if inrange(tc_date,tm(2021m2),tm(2022m11))

format tc_date %tmMonYY
twoway line ertc_amendment tc_date if year == 2020 & any_ertc >= 5 & ratio <= 0.4, lcolor(gs0) || ///
    line ertc_amendment tc_date if year == 2021 & any_ertc >= 5 & ratio <= 0.4, lcolor(gs0) lpattern("--") ///
        legend(order(1 "Credit generated in 2020Q2-2020Q4" 2 "Credit generated in 2021Q1-2021Q4") cols(1)) scheme(s1color) ///
        ytitle("Amount of ERC on amended return (bil)") ///
        xtitle("Month of amendment processing") ///
		xscale(r(`=tm(2021m1)' `=tm(2022m11)')) xlabel(`=tm(2021m1)' `=tm(2021m7)' `=tm(2022m1)' `=tm(2022m7)' `=tm(2022m11)')

list
graph export "$outdir/figures/amendment_timing.eps", replace
